package com.ruoyi.system.service.vantservice.teamservice.impl;

import com.ruoyi.system.domain.construction.RentalLabel;
import com.ruoyi.system.domain.construction.RentalService;
import com.ruoyi.system.domain.construction.Team;
import com.ruoyi.system.mapper.vant.team.ApiRentalMapper;
import com.ruoyi.system.service.vantservice.teamservice.ApiRentalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 租赁服务Service实现层
 */
@Service
public class ApiRentalServiceImpl implements ApiRentalService {

    @Autowired
    private ApiRentalMapper apiRentalMapper;

    /**
     * 查询租赁服务列表
     * @return
     */
    public List<Team> selectLeaseList(){
        return apiRentalMapper.selectLeaseList();
    }

    /**
     * 根据分类ID查询租赁服务商品列表
     * @param teamId
     * @return
     */
    public List<RentalService> selectRentalServiceList(Integer teamId){
        if(teamId == 0){
            return apiRentalMapper.selectRentalService();
        }
        return apiRentalMapper.selectRentalServiceList(teamId);
    }

    /**
     * 查询租赁服务商品信息
     * @param rentalId
     * @return
     */
    public RentalService selectRentalServiceById(Long rentalId){
        return apiRentalMapper.selectRentalServiceById(rentalId);
    }

    /**
     * 查询租赁服务规格列表
     * @param rentalId
     * @return
     */
    public List<RentalLabel> selectRentalLabelByServiceId(Long rentalId){
        return apiRentalMapper.selectRentalLabelByServiceId(rentalId);
    }

    @Override
    public List<RentalService> selectRentalServiceListOne(String address) {
        return apiRentalMapper.selectRentalServiceListOne(address);
    }

    @Override
    public List<RentalService> selectRentalServiceListTwo(RentalService rentalService) {
        return apiRentalMapper.selectRentalServiceListTwo(rentalService);
    }
}
